package com.example.seckilldemo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.seckilldemo.entity.TSeckillGoods;
import com.example.seckilldemo.mapper.TSeckillGoodsMapper;
import com.example.seckilldemo.service.ITSeckillGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

/**
 * 秒杀商品表 服务实现类
 *
 * @author LiChao
 * @since 2022-03-03
 */
@Service
@Primary
public class TSeckillGoodsServiceImpl extends ServiceImpl<TSeckillGoodsMapper, TSeckillGoods> implements ITSeckillGoodsService {
          @Autowired
      private  TSeckillGoodsMapper tSeckillGoodsMapper;


    @Override
    public int decreseStock(TSeckillGoods tSeckillGoods) {
        System.out.println("ttt"+tSeckillGoods.getGoodsId());
      int ans= tSeckillGoodsMapper.decreaseStock(tSeckillGoods);
      return ans;
    }
}
